Trees | Indices | Toggle frames |
---|
Arbitrary inline element positioned within a formatted document.
Elements behave like a single glyph in the document. They are measured by their horizontal advance, ascent above the baseline, and descent below the baseline.
The pyglet layout classes reserve space in the layout for elements and call the element's methods to ensure they are rendered at the appropriate position.
If the size of a element (any of the advance, ascent, or descent instance variables) is modified it is the application's responsibility to trigger a reflow of the appropriate area in the affected layouts. This can be done by forcing a style change over the element's position.
__init__(self, ascent, descent, advance) | |
place(self,
layout,
x,
y)
Construct an instance of the element at the given coordinates.
|
|
remove(self,
layout)
Remove this element from a layout.
|
int |
position
Position of the element within the
document.
|
int |
advance
Width of the element, in pixels.
|
int |
ascent
Ascent of the element above the baseline, in pixels.
|
int |
descent
Descent of the element below the baseline, in pixels.
|
Construct an instance of the element at the given coordinates.
Called when the element's position within a layout changes, either due to the initial condition, changes in the document or changes in the layout size.
It is the responsibility of the element to clip itself against the layout boundaries, and position itself appropriately with respect to the layout's position and viewport offset.
The TextLayout.top_state
graphics state implements this transform
and clipping into window space.
Remove this element from a layout.
The counterpart of place; called when the element is no longer visible in the given layout.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:19 2009 | http://epydoc.sourceforge.net |